package com.wzcl.app.config;


import com.qiniu.util.Auth;
import lombok.Data;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;


@Log4j2
@Configuration
@PropertySource({"classpath:application-config.properties"})
@Data
public class QiNiuConfig {

    @Value("${qiNiu.accessKey}")
    private String accessKey;

    @Value("${qiNiu.secretKey}")
    private String secretKey;

    //认证实例
    @Bean
    public Auth auth() {
        return Auth.create(accessKey, secretKey);
    }
}
